package biz.inspeed.test.concurrent;

import biz.inspeed.test.tool.CommonUtil;

public class Main1219 {

	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException {
		long lastTime = -1;
		while(true){
			long time = System.currentTimeMillis() - lastTime;
			long sleep = 5000 - time;
			if(sleep > 0){
				System.out.println("need wait " + sleep);
				Thread.currentThread().sleep(sleep);
			}else{
				System.out.println("do not need wait,just go!!");
			}
			lastTime = System.currentTimeMillis();
			System.out.println(CommonUtil.getCurrentTime());
		}
	}

}
